import {
    createApp
} from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// import JsppUI from '@/swipers/jspp-ui'
// import Swiper_UI from 'lib-swipers'
const app = createApp(App)
app.directive('lazyload', {
    mounted(el, binding) {
        const observer = new IntersectionObserver(([{
            isIntersecting
        }]) => {
            if (isIntersecting) {
                observer.unobserve(el)
                el.onerror = () => {
                    el.src = defaultImg
                }
                el.src = binding.value
            }
        }, {
            threshold: 0.01
        })
        observer.observe(el)

    }
})


app.use(store).use(router).use(ElementPlus).mount('#app')